.class public Lcom/instagram/android/d/k/p;
.super Lcom/instagram/android/d/k/n;
.source "IgTreeResponseParser.java"


# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "<T:",
        "Ljava/lang/Object;",
        ">",
        "Lcom/instagram/android/d/k/n",
        "<TT;>;"
    }
.end annotation


# direct methods
.method public constructor <init>()V
    .locals 0

    .prologue
    .line 20
    invoke-direct {p0}, Lcom/instagram/android/d/k/n;-><init>()V

    return-void
.end method

.method private final a(Lcom/fasterxml/jackson/databind/JsonNode;Lcom/instagram/android/d/k/m;)Z
    .locals 5
    .parameter
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lcom/fasterxml/jackson/databind/JsonNode;",
            "Lcom/instagram/android/d/k/m",
            "<TT;>;)Z"
        }
    .end annotation

    .prologue
    .line 74
    const-string v0, "error_title"

    invoke-virtual {p1, v0}, Lcom/fasterxml/jackson/databind/JsonNode;->get(Ljava/lang/String;)Lcom/fasterxml/jackson/databind/JsonNode;

    move-result-object v0

    .line 75
    if-eqz v0, :cond_0

    .line 76
    invoke-virtual {v0}, Lcom/fasterxml/jackson/databind/JsonNode;->asText()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p2, v0}, Lcom/instagram/android/d/k/m;->d(Ljava/lang/String;)V

    .line 79
    :cond_0
    const-string v0, "checkpoint_url"

    invoke-virtual {p1, v0}, Lcom/fasterxml/jackson/databind/JsonNode;->get(Ljava/lang/String;)Lcom/fasterxml/jackson/databind/JsonNode;

    move-result-object v0

    .line 80
    if-eqz v0, :cond_1

    .line 81
    invoke-virtual {v0}, Lcom/fasterxml/jackson/databind/JsonNode;->asText()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p2, v0}, Lcom/instagram/android/d/k/m;->b(Ljava/lang/String;)V

    .line 84
    :cond_1
    const-string v0, "status"

    invoke-virtual {p1, v0}, Lcom/fasterxml/jackson/databind/JsonNode;->get(Ljava/lang/String;)Lcom/fasterxml/jackson/databind/JsonNode;

    move-result-object v0

    .line 85
    if-eqz v0, :cond_2

    .line 86
    invoke-virtual {v0}, Lcom/fasterxml/jackson/databind/JsonNode;->asText()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p2, v0}, Lcom/instagram/android/d/k/m;->c(Ljava/lang/String;)V

    .line 109
    :cond_2
    const-string v0, "message"

    invoke-virtual {p1, v0}, Lcom/fasterxml/jackson/databind/JsonNode;->get(Ljava/lang/String;)Lcom/fasterxml/jackson/databind/JsonNode;

    move-result-object v0

    .line 110
    if-eqz v0, :cond_8

    .line 111
    invoke-virtual {v0}, Lcom/fasterxml/jackson/databind/JsonNode;->isObject()Z

    move-result v1

    if-eqz v1, :cond_7

    .line 112
    const-string v1, "errors"

    invoke-virtual {v0, v1}, Lcom/fasterxml/jackson/databind/JsonNode;->get(Ljava/lang/String;)Lcom/fasterxml/jackson/databind/JsonNode;

    move-result-object v0

    .line 113
    if-eqz v0, :cond_6

    .line 114
    new-instance v1, Ljava/util/ArrayList;

    invoke-direct {v1}, Ljava/util/ArrayList;-><init>()V

    .line 116
    invoke-virtual {v0}, Lcom/fasterxml/jackson/databind/JsonNode;->elements()Ljava/util/Iterator;

    move-result-object v2

    .line 117
    :cond_3
    :goto_0
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_4

    .line 118
    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/fasterxml/jackson/databind/JsonNode;

    .line 119
    const-string v3, "null"

    invoke-virtual {v0}, Lcom/fasterxml/jackson/databind/JsonNode;->asText()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-nez v3, :cond_3

    .line 120
    invoke-virtual {v0}, Lcom/fasterxml/jackson/databind/JsonNode;->asText()Ljava/lang/String;

    move-result-object v0

    invoke-interface {v1, v0}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    goto :goto_0

    .line 124
    :cond_4
    invoke-virtual {p2, v1}, Lcom/instagram/android/d/k/m;->b(Ljava/util/List;)V

    .line 149
    :cond_5
    :goto_1
    const/4 v0, 0x1

    return v0

    .line 126
    :cond_6
    const-string v0, "API response message does not contain \"errors\" field"

    const-string v1, "message"

    invoke-virtual {p1, v1}, Lcom/fasterxml/jackson/databind/JsonNode;->get(Ljava/lang/String;)Lcom/fasterxml/jackson/databind/JsonNode;

    move-result-object v1

    invoke-virtual {v1}, Lcom/fasterxml/jackson/databind/JsonNode;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/instagram/g/c;->b(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_1

    .line 130
    :cond_7
    invoke-virtual {v0}, Lcom/fasterxml/jackson/databind/JsonNode;->asText()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p2, v0}, Lcom/instagram/android/d/k/m;->a(Ljava/lang/String;)V

    goto :goto_1

    .line 133
    :cond_8
    const-string v0, "errors"

    invoke-virtual {p1, v0}, Lcom/fasterxml/jackson/databind/JsonNode;->get(Ljava/lang/String;)Lcom/fasterxml/jackson/databind/JsonNode;

    move-result-object v0

    .line 134
    if-eqz v0, :cond_5

    .line 135
    new-instance v1, Ljava/util/ArrayList;

    invoke-direct {v1}, Ljava/util/ArrayList;-><init>()V

    .line 137
    invoke-virtual {v0}, Lcom/fasterxml/jackson/databind/JsonNode;->elements()Ljava/util/Iterator;

    move-result-object v2

    .line 138
    :cond_9
    :goto_2
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_a

    .line 139
    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/fasterxml/jackson/databind/JsonNode;

    .line 140
    const-string v3, "null"

    invoke-virtual {v0}, Lcom/fasterxml/jackson/databind/JsonNode;->asText()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-nez v3, :cond_9

    .line 141
    invoke-virtual {v0}, Lcom/fasterxml/jackson/databind/JsonNode;->asText()Ljava/lang/String;

    move-result-object v0

    invoke-interface {v1, v0}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    goto :goto_2

    .line 145
    :cond_a
    invoke-virtual {p2, v1}, Lcom/instagram/android/d/k/m;->b(Ljava/util/List;)V

    goto :goto_1
.end method

.method private b(Lcom/fasterxml/jackson/databind/JsonNode;)Lcom/instagram/android/d/b/d;
    .locals 2
    .parameter

    .prologue
    .line 167
    const-string v0, "key"

    invoke-virtual {p1, v0}, Lcom/fasterxml/jackson/databind/JsonNode;->get(Ljava/lang/String;)Lcom/fasterxml/jackson/databind/JsonNode;

    move-result-object v0

    invoke-virtual {v0}, Lcom/fasterxml/jackson/databind/JsonNode;->textValue()Ljava/lang/String;

    move-result-object v0

    .line 168
    const-string v1, "time"

    invoke-virtual {p1, v1}, Lcom/fasterxml/jackson/databind/JsonNode;->get(Ljava/lang/String;)Lcom/fasterxml/jackson/databind/JsonNode;

    move-result-object v1

    invoke-virtual {v1}, Lcom/fasterxml/jackson/databind/JsonNode;->asText()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Ljava/lang/Float;->parseFloat(Ljava/lang/String;)F

    move-result v1

    invoke-static {v1}, Ljava/lang/Float;->valueOf(F)Ljava/lang/Float;

    move-result-object v1

    .line 169
    invoke-static {v0, v1}, Lcom/instagram/android/d/b/d;->a(Ljava/lang/String;Ljava/lang/Float;)Lcom/instagram/android/d/b/d;

    move-result-object v0

    .line 170
    return-object v0
.end method

.method private b(Lcom/fasterxml/jackson/databind/JsonNode;Lcom/instagram/android/d/k/m;)V
    .locals 3
    .parameter
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lcom/fasterxml/jackson/databind/JsonNode;",
            "Lcom/instagram/android/d/k/m",
            "<TT;>;)V"
        }
    .end annotation

    .prologue
    .line 153
    const-string v0, "_messages"

    invoke-virtual {p1, v0}, Lcom/fasterxml/jackson/databind/JsonNode;->get(Ljava/lang/String;)Lcom/fasterxml/jackson/databind/JsonNode;

    move-result-object v0

    .line 154
    if-eqz v0, :cond_1

    .line 155
    invoke-virtual {v0}, Lcom/fasterxml/jackson/databind/JsonNode;->elements()Ljava/util/Iterator;

    move-result-object v1

    .line 156
    new-instance v2, Ljava/util/ArrayList;

    invoke-direct {v2}, Ljava/util/ArrayList;-><init>()V

    .line 157
    :goto_0
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 158
    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/fasterxml/jackson/databind/JsonNode;

    .line 159
    invoke-direct {p0, v0}, Lcom/instagram/android/d/k/p;->b(Lcom/fasterxml/jackson/databind/JsonNode;)Lcom/instagram/android/d/b/d;

    move-result-object v0

    invoke-interface {v2, v0}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    goto :goto_0

    .line 161
    :cond_0
    invoke-virtual {p2, v2}, Lcom/instagram/android/d/k/m;->a(Ljava/util/List;)V

    .line 163
    :cond_1
    return-void
.end method


# virtual methods
.method public synthetic a(Lch/boye/httpclientandroidlib/HttpResponse;)Lcom/instagram/android/d/k/h;
    .locals 1
    .parameter

    .prologue
    .line 20
    invoke-virtual {p0, p1}, Lcom/instagram/android/d/k/p;->b(Lch/boye/httpclientandroidlib/HttpResponse;)Lcom/instagram/android/d/k/m;

    move-result-object v0

    return-object v0
.end method

.method public a(Lcom/fasterxml/jackson/databind/JsonNode;)Ljava/lang/Object;
    .locals 1
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lcom/fasterxml/jackson/databind/JsonNode;",
            ")TT;"
        }
    .end annotation

    .prologue
    .line 68
    const/4 v0, 0x0

    return-object v0
.end method

.method public final b(Lch/boye/httpclientandroidlib/HttpResponse;)Lcom/instagram/android/d/k/m;
    .locals 5
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lch/boye/httpclientandroidlib/HttpResponse;",
            ")",
            "Lcom/instagram/android/d/k/m",
            "<TT;>;"
        }
    .end annotation

    .prologue
    const/4 v1, 0x0

    .line 24
    new-instance v2, Lcom/instagram/android/d/k/m;

    invoke-direct {v2}, Lcom/instagram/android/d/k/m;-><init>()V

    .line 27
    :try_start_0
    invoke-virtual {p0, p1}, Lcom/instagram/android/d/k/p;->c(Lch/boye/httpclientandroidlib/HttpResponse;)V

    .line 29
    invoke-interface {p1}, Lch/boye/httpclientandroidlib/HttpResponse;->getEntity()Lch/boye/httpclientandroidlib/HttpEntity;

    move-result-object v0

    .line 30
    invoke-static {v0}, Lch/boye/httpclientandroidlib/util/EntityUtils;->toString(Lch/boye/httpclientandroidlib/HttpEntity;)Ljava/lang/String;

    move-result-object v0

    .line 31
    invoke-static {}, Lcom/instagram/android/service/f;->a()Lcom/instagram/android/service/f;

    move-result-object v3

    .line 32
    const-class v4, Lcom/fasterxml/jackson/databind/JsonNode;

    invoke-virtual {v3, v0, v4}, Lcom/fasterxml/jackson/databind/ObjectMapper;->readValue(Ljava/lang/String;Ljava/lang/Class;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/fasterxml/jackson/databind/JsonNode;

    .line 34
    if-nez v0, :cond_0

    move-object v0, v1

    .line 47
    :goto_0
    return-object v0

    .line 38
    :cond_0
    invoke-direct {p0, v0, v2}, Lcom/instagram/android/d/k/p;->b(Lcom/fasterxml/jackson/databind/JsonNode;Lcom/instagram/android/d/k/m;)V

    .line 39
    invoke-direct {p0, v0, v2}, Lcom/instagram/android/d/k/p;->a(Lcom/fasterxml/jackson/databind/JsonNode;Lcom/instagram/android/d/k/m;)Z

    .line 41
    invoke-virtual {p0, v0}, Lcom/instagram/android/d/k/p;->a(Lcom/fasterxml/jackson/databind/JsonNode;)Ljava/lang/Object;

    move-result-object v0

    invoke-virtual {v2, v0}, Lcom/instagram/android/d/k/m;->a(Ljava/lang/Object;)V
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    move-object v0, v2

    .line 47
    goto :goto_0

    .line 43
    :catch_0
    move-exception v0

    move-object v0, v1

    .line 44
    goto :goto_0
.end method

.method public c(Lch/boye/httpclientandroidlib/HttpResponse;)V
    .locals 0
    .parameter

    .prologue
    .line 58
    return-void
.end method
